package com.huilian.iotbox.mqtt.server.base.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.huilian.iotbox.mqtt.server.base.dao.MerchantDao;
import com.huilian.iotbox.mqtt.server.base.service.MerchantService;
import com.huilian.iotbox.data.dto.MerchantDto;
import com.huilian.iotbox.data.vo.MerchantVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 谢洛涛
 * @date 2021/6/25 10:03
 */
@Service
@Slf4j
public class MerchantServiceImpl implements MerchantService {
    @Resource
    private MerchantDao merchantDao;

    @Override
    public PageInfo findList(MerchantDto merchantDto) {
        PageHelper.startPage(merchantDto.getPageNum(), merchantDto.getPageSize(), " m.createTime desc");
        List<MerchantVo> list = merchantDao.findList(merchantDto);
        PageInfo pageInfo = new PageInfo(list);
        return pageInfo;
    }
}
